package com.yixin.hospital.entity.dto.req.purchaseorder;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;

@ApiModel("入库请求体")
@Data
public class GoDownDrugReqDTO {

    @ApiModelProperty("采购单id")
//    @NotNull(message = "采购单id不能为空")
    private Long purchaseOrderId;

    @ApiModelProperty("所属库房")
    @NotNull(message = "所属库房id不能为空")
    private Long drugDepositoryId;

    @ApiModelProperty("来源")
    @NotBlank(message = "来源不能为空")
    private String source;

    @ApiModelProperty("药品列表")
    @NotNull(message = "药品列表不能为空")
    List<GoDownDrugBO> purchaseOrderDrugList;

    @Data
    public static class GoDownDrugBO{

        @ApiModelProperty("采购单操作表id")
        private Long operationId;

        @ApiModelProperty("库存")
        private Integer sourceNum;

        @ApiModelProperty("药品编码")
        @NotBlank(message = "药品编码不能为空")
        private String drugCode;

        @ApiModelProperty("批号")
        @NotBlank(message = "批号不能为空")
        private String batchCode;

        @ApiModelProperty("入库数量")
        private Integer putNum;

        @ApiModelProperty("药品生产日期")
        @NotNull(message = "药品生产日期不能为空")
        @JsonFormat(pattern = "yyyy-MM-dd")
        private Date productTime;

        @ApiModelProperty("保质期")
        @NotNull(message = "保质期不能为空")
        private Integer qualityTime;

        @ApiModelProperty("药品有效期")
        @NotNull(message = "药品有效期不能为空")
        @JsonFormat(pattern = "yyyy-MM-dd")
        private Date expiration;

        @ApiModelProperty("供应商")
        private Integer supplier;

        @ApiModelProperty("进货价格")
        private Integer costPrice;

    }
}
